package com.hyyt.shopjsp.common.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import javax.servlet.http.HttpServletRequest;

/**
 * Copyright (c) 2016 ShopJsp. All Rights Reserved.
 * ============================================================================
 * 版权所有 2011 - 今 北京华宇盈通科技有限公司，并保留所有权利。
 * ----------------------------------------------------------------------------
 * 提示：在未取得SHOPJSP商业授权之前，您不能将本软件应用于商业用途，否则SHOPJSP将保留追究的权力。
 * ----------------------------------------------------------------------------
 * 官方网站：http://www.shopjsp.com
 * ============================================================================
 * 开放访问页面及接口类
 * @author CuiYS on 2016/10/27 0027上午 11:31.
 */
@Controller
@RequestMapping("/open")
public class CommonController extends BaseController {

    private final String basePath = "/error/";

    /**
     * shiro 权限不足提醒
     *
     * @return
     */
    @RequestMapping(value = "unauthorized", method = RequestMethod.GET)
    public String unauthorized() {
        return basePath + "403";
    }

    /**
     * 404错误
     *
     * @param request
     * @return
     */
    @RequestMapping("404")
    public String not404(HttpServletRequest request) {
        return basePath + "404";
    }

    /**
     * 500错误
     *
     * @param request
     * @return
     */
    @RequestMapping("500")
    public String error500(HttpServletRequest request) {
        return basePath + "500";
    }

    /**
     * 提交太过频繁
     *
     * @return
     */
    @RequestMapping(value = "noRepeat", method = RequestMethod.GET)
    public String noRepeat() {
        return basePath + "no_repeat";
    }

}
